package com.oocl.euc.core.maintenance.controller;

import com.oocl.euc.core.maintenance.model.FunctionAuth;
import com.oocl.euc.core.maintenance.service.FunctionAuthService;
import com.oocl.euc.core.maintenance.vo.FunctionAuthEditVO;
import com.oocl.euc.framework.base.controller.RESTController;
import com.oocl.euc.framework.base.service.BaseService;
import com.oocl.euc.framework.common.utils.ResponseEntityUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/rest/functionAuth")
public class FunctionAuthController extends RESTController<FunctionAuth, Long> {

    @Autowired
    private FunctionAuthService functionAuthService;

    @Override
    protected BaseService<FunctionAuth, Long> getBaseService() {
        return functionAuthService;
    }


    @RequestMapping(value = "/add",method = RequestMethod.POST, consumes = "application/json")
    @ResponseBody
    public ResponseEntity addFunctionAuth(@RequestBody FunctionAuthEditVO functionAuthEditVO) {
        return ResponseEntityUtil.successInRestful(functionAuthService.addFunctionAuth(functionAuthEditVO));
    }

}
